Skip to main content

Create Content

The endpoint is used to generate Single Image and Carousel posts using Model Version 4, and Video posts.

Model Version 2 is deprecated

Model Version 2 is deprecated and can no longer be used to generate single images or carousels. Single image and carousel requests with model_version set to 2 are rejected with HTTP status code 400 and the error below. Please use Model Version 4 instead. If you omit model_version, Model Version 4 is used by default.

{
"errors": [{
"field": "model_version",
"detail": "Model Version 2 is deprecated. Please use Model Version 4 instead.",
"solution": "Pass model_version as 4 or omit the model_version field (it defaults to 4). See documentation: https://predis.ai/developers/"
}]
}

Videos are not affected: media_type video keeps working with video_duration, template_ids, media_urls and headlines, and model_version is ignored for videos. For single images and carousels, the meme and quotes post types, template_ids, media_urls and headlines are no longer supported, and requests that include them are rejected with HTTP status code 400. The Get Templates endpoint now lists video templates only.

Request URL​

  • POST https://brain.predis.ai/predis_api/v1/create_content/

Request Payload​

Note - Please use "Payload Type" as form-data when you calling this API.

NameDescriptionTypeDefault ValuePossible ValuesRequired
brand_idUnique Identifier of your Brand. You can learn more about locating your Brand ID by visiting the link provided here.StringNoneYOUR_BRAND_IDYes
textProvide the topic for which you intend to create the post. Make sure the topic is at least 20 characters long and consists of a minimum of 3 words to ensure accurate output.StringNoneAny StringYes
model_versionSpecify the version of the model to use for single images and carousels. Only version 4 is supported.
Version 2 is deprecated and single image or carousel requests using it will be rejected. Ignored when media_type is video.
String44No
n_postsSpecify the number of posts you want to generate in a single request.Integer11 to 10No
input_languageChoose the language for your input text field.Stringenglishmalay, chinese (traditional), croatian, english, dutch, indonesian, vietnamese, portuguese_br, finnish, french, german, italian, norwegian, polish, romanian, czech, spanish, swedish, turkish, danish, hungarianNo
output_languageChoose the language in which you want to generate the post.Stringenglishmalay, chinese (traditional), croatian, english, dutch, indonesian, vietnamese, portuguese_br, finnish, french, german, italian, norwegian, polish, romanian, czech, spanish, swedish, turkish, danish, hungarianNo
media_typeSpecify the type of media you want to generate.
single_image and carousel are made with Model Version 4. video is made with the video engine, whatever model_version is set to.
Stringsingle_imagesingle_image, carousel, videoNo
video_durationSpecify the type of your video.
This field is not required when template_ids are selected. However, it is required when the media_type value is set to video.
Stringshortshort, longNo
template_idsProvide this information only when you want your video to be generated using specific video templates. List them with the Get Templates API.
You can provide a list of template IDs in the following format:
Sample 1: ["template_id1"]
Sample 2: ["template_id1", "template_id2", "template_id3"]
Supported only when media_type is video
List of strings[][]No
media_urlsProvide a list of URLs for images/videos that you want to use in your video.
Here are two sample formats:
Sample 1: ["url1"]
Sample 2: ["url1", "url2", "url3"]
Supported only when media_type is video
List of strings[][]No
headlinesProvide this input when you wish to override the AI-generated text in the generated video.
Supported only when media_type is video
ListNoneNo
color_palette_typeChoose the color palette in which you would like your content to be generated.
If you have specified palette as brand but haven't set the brand colors, the content will be automatically generated using the ai_suggested palette.
Stringai_suggestedbrand, ai_suggestedNo
brand_detailsProvide brand details to make sure AI generates content in the given brand details only.DictionaryNone Please check Example hereNo

Sample Success Response​

{
"post_ids": [
"..."
],
"post_status": "inProgress",
"errors": [{"..."}]
}

Sample Error Response​

{
"errors": [{
"detail": "...",
"solution": "..."
}]
}

Response Codes​

HTTP Status CodeError CodeUser MessageRecommended solution
429001Maximum number of requests reachedMaximum number of hourly requests reached You have been rate-limited. Wait for sometime and try again
400002Invalid brand_id providedYou have provided an invalid brand_id. Please provide a valid brand_id and try again. Read more here
400003You have reached your post generation limitYou have exhausted the credits available in your plan. Please upgrade to a higher plan or wait until the limit resets
400004You have reached the maximum number of posts inProgressPlease wait until the posts in progress gets completed and then try again
400005Your request method is invalidPlease make a POST request and then try again
400006Your provided text is too smallThe provided text should contain atleast 3 words and 20 characters for best results
400007The provided value for the media_type field is not validMake sure the value is one of single_image, carousel or video
400008The provided value for the input_language or output_language field is not validMake sure the passed value is supported. Please check the Request Parameters in the above table for more details
400009The provided value for the video_duration field is not validMake sure the value is either short or long
400-Model Version 2 is deprecated. Please use Model Version 4 instead.Pass model_version as 4 or omit the model_version field (it defaults to 4)
400-The provided model_version is not supportedOnly model_version 4 is supported
400-model_version 4 is not available on your planPlease upgrade your plan to generate content via the API

Rate Limiting​

Standard API rate limits apply to this endpoint. Read more about the rate limits here